<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">公告列表</h4>
</div>

<div class="wrapper-md ng-scope" ng-controller="bulletinBoardCtrl">
    <div class="panel panel-default">
        <div class="row wrapper">
            <div class="col-sm-11">
                <form class="form-inline ng-pristine ng-valid">
                    <div class="form-group">
                        <label class="control-label">标题</label>
                        <input type="text" class="input-sm form-control" ng-model="bulletinBoard.title">
                    </div>
                    <div class="form-group">
                        <label class="control-label">收信代理级别</label>
                        <select class="form-control" mg-model="bulletinBoard.level">
                            <option value="">所有</option>
                            <option value="0">省级</option>
                            <option value="1">市级</option>
                            <option value="2">区县级</option>
                        </select>
                    </div>
                    <button class="btn btn-sm btn-default" ng-click="query()">查询</button>
                </form>
            </div>
            <div class="col-sm-1">
                <div class="pull-right">
                    <a class="btn btn-sm btn-info" ng-click="openAdd()">发布公告</a>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>


        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>标题</th>
                    <th>收信人</th>
                    <th>发布时间</th>
                    <th width="130" class="text-center">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="a in list">
                    <td>
                        {{a.title}}
                    </td>
                    <td>
                        <span ng-if="a.agentName != ''">{{ a.agentName }}</span>
                        <span ng-if="a.agentName == '' && a.level == -1">所有代理商</span>
                        <span ng-if="a.agentName == '' && a.level == 0">省级代理</span>
                        <span ng-if="a.agentName == '' && a.level == 1">市级代理</span>
                        <span ng-if="a.agentName == '' && a.level == 2">区/县级代理</span>
                    </td>
                    <td>
                        {{ a.createdTime }}
                    </td>
                    <td class="t-btns text-center">
                        <div class="btn-group dropdown" dropdown="">
                            <button class="btn btn-sm btn-default" dropdown-toggle=""
                                    aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li><a href="" ng-click="openEdit(a)">修改</a></li>
                                <li><a href="" ng-click="openDelete(a)">删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-4 text-left">
                    <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                </div>
                <div class="col-sm-8 text-right text-center-xs">
                    <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                previous-text="上一页" next-text="下一页"
                                first-text="首页" last-text="尾页"></pagination>
                </div>
            </div>
        </footer>
    </div>
</div>